﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace Artshare
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            ApiMethods api = new ApiMethods();
            try
            {
                
                if (api.hasValidToken())
                {
                    MessageBox.Show("valid token:");

                }
                else
                {
                    api.authApp();
                    MessageBox.Show("Det lader til det at det er første gang du kører programmet, tryk ok når du har tilladt applikationen");
                    api.getToken();
                    
                }
                
            }
            catch (Exception ex)
            {
                MessageBox.Show("blimey, there was an error");
                Console.WriteLine(ex.Data);
            }
            api.searchByTag("daniel");
            Application.Run(new Form1());
        }
    }
}
